name: pre-commit run_id: commands[0] env HOME: /home/jenkins env LANG: C.UTF-8 env PATH: /w/workspace/integration-test-tox-verify-master/.tox/pre-commit/bin:/opt/pyenv/bin:/tmp/venv-bp2g/bin:/opt/pyenv/shims:/home/jenkins/.local/bin:/opt/sdkman/candidates/mvnd/current/bin:/opt/sdkman/candidates/maven/current/bin:/opt/sdkman/candidates/java/current/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin env PIP_DISABLE_PIP_VERSION_CHECK: 1 env PIP_USER: 0 env PYTHONHASHSEED: 3332191549 env PYTHONIOENCODING: utf-8 env SSH_AUTH_SOCK: ******************************** env TOX_ENV_DIR: /w/workspace/integration-test-tox-verify-master/.tox/pre-commit env TOX_ENV_NAME: pre-commit env TOX_WORK_DIR: /w/workspace/integration-test-tox-verify-master/.tox env VIRTUAL_ENV: /w/workspace/integration-test-tox-verify-master/.tox/pre-commit env __TOX_ENVIRONMENT_VARIABLE_ORIGINAL_CI: true metadata pid: 2598 cwd: /w/workspace/integration-test-tox-verify-master allow: /w/workspace/integration-test-tox-verify-master/.tox/pre-commit/bin/* cmd: pre-commit run --all-files --show-diff-on-failure exit_code: 1 [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [WARNING] repo `https://github.com/pre-commit/pre-commit-hooks` uses deprecated stage names (commit, push) which will be removed in a future version. Hint: often `pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks` will fix this. if it does not -- consider reporting an issue to that repo. [INFO] Initializing environment for https://github.com/PyCQA/flake8. [INFO] Initializing environment for https://github.com/psf/black. [INFO] Initializing environment for https://github.com/MarketSquare/robotframework-tidy. [INFO] Initializing environment for https://github.com/MarketSquare/robotframework-tidy:robotframework==6.1.1. [INFO] Initializing environment for https://github.com/jorisroovers/gitlint. [INFO] Initializing environment for https://github.com/jorisroovers/gitlint:./gitlint-core[trusted-deps]. [INFO] Initializing environment for local:rstcheck,sphinx. [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/PyCQA/flake8. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/psf/black. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/MarketSquare/robotframework-tidy. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for local. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... trim trailing whitespace.................................................Passed flake8...................................................................Passed black....................................................................Failed - hook id: black - files were modified by this hook reformatted tools/fastbgp/play.py All done! ✨ 🍰 ✨ 1 file reformatted, 104 files left unchanged. robotidy.................................................................Passed rstcheck.................................................................Passed pre-commit hook(s) made changes. If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`. To run `pre-commit` as part of git workflow, use `pre-commit install`. All changes made by hooks: diff --git a/tools/fastbgp/play.py b/tools/fastbgp/play.py index 9f3775ba..b3c5b4bb 100755 --- a/tools/fastbgp/play.py +++ b/tools/fastbgp/play.py @@ -179,7 +179,9 @@ def parse_arguments(): str_help = "Link-State NLRI supported" parser.add_argument("--bgpls", default=False, type=bool, help=str_help) str_help = "Link-State NLRI: Identifier" - parser.add_argument("-lsid", "--lsid", dest="lsid", default=1, type=int, help=str_help) + parser.add_argument( + "-lsid", "--lsid", dest="lsid", default=1, type=int, help=str_help + ) str_help = "Link-State NLRI: Policy Color" parser.add_argument( "--color", "-lstid", dest="color", default=100, type=int, help=str_help @@ -967,18 +969,16 @@ class MessageGenerator(object): """ if self.nlri_type == 6: identifier = self.base_identifier + int(index / self.lsid_step) - sid = ipaddr.IPv6Address(int(self.base_sid) + int(index / self.srv6_sid_step)) + sid = ipaddr.IPv6Address( + int(self.base_sid) + int(index / self.srv6_sid_step) + ) srv6_nlri_values = self.srv6_nlri_default.copy() srv6_nlri_values["Identifier"] = identifier srv6_nlri_values["SID"] = sid return srv6_nlri_values - identifier = self.ls_nlri_default["Identifier"] + int( - index / self.lsid_step - ) - color = self.ls_nlri_default["Color"] + int( - index / self.color_step - ) + identifier = self.ls_nlri_default["Identifier"] + int(index / self.lsid_step) + color = self.ls_nlri_default["Color"] + int(index / self.color_step) discriminator = self.ls_nlri_default["Discriminator"] + int( index / self.discriminator_step ) @@ -1661,17 +1661,12 @@ class MessageGenerator(object): mp_reach_content = ( b"\x40\x04" b"\x47" - b"\x04" - + struct.pack(">I", int(next_hop)) - + b"\x00" - + nlri + b"\x04" + struct.pack(">I", int(next_hop)) + b"\x00" + nlri ) path_attributes_hex += ( b"\x80" - b"\x0e" - + struct.pack("B", len(mp_reach_content)) - + mp_reach_content + b"\x0e" + struct.pack("B", len(mp_reach_content)) + mp_reach_content ) elif self.nlri_type == 6: @@ -1711,9 +1706,7 @@ class MessageGenerator(object): path_attributes_hex += ( b"\x80" - b"\x0e" - + struct.pack("B", len(mp_reach_content)) - + mp_reach_content + b"\x0e" + struct.pack("B", len(mp_reach_content)) + mp_reach_content ) # 5. BGP-LS Attribute (Attribute 29) @@ -1739,9 +1732,7 @@ class MessageGenerator(object): attr_29_content = tlv_1250 + tlv_1252 path_attributes_hex += ( b"\x80" - b"\x1d" - + struct.pack("B", len(attr_29_content)) - + attr_29_content + b"\x1d" + struct.pack("B", len(attr_29_content)) + attr_29_content ) # Total Path Attributes Length